<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ page import="com.ffms.entity.FamilyMember" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    String flag = request.getParameter("flag");//用request得到
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <base href="<%=basePath%>"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <style type="text/css">
        <!--
        body {
            margin-left: 0px;
            margin-top: 0px;
            margin-right: 0px;
            margin-bottom: 0px;
        }

        .tabfont01 {
            font-family: "宋体";
            font-size: 9px;
            color: #555555;
            text-decoration: none;
            text-align: center;
        }

        .font051 {
            font-family: "宋体";
            font-size: 12px;
            color: #333333;
            text-decoration: none;
            line-height: 20px;
        }

        .font201 {
            font-family: "宋体";
            font-size: 12px;
            color: #FF0000;
            text-decoration: none;
        }

        .button {
            font-family: "宋体";
            font-size: 14px;
            height: 37px;
        }

        html {
            overflow-x: auto;
            overflow-y: auto;
            border: 0;
        }

        -->
    </style>

    <link href="css/css.css" rel="stylesheet" type="text/css"/>
    <link href="css/style.css" rel="stylesheet" type="text/css"/>
    <script type="text/JavaScript">

    </script>
</head>
<SCRIPT language="JavaScript">
    function sousuo() {
        window.open("gaojisousuo.htm", "", "depended=0,alwaysRaised=1,width=800,height=510,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0");
    }

    function selectAll() {
        var obj = document.fom.elements;
        for (var i = 0; i < obj.length; i++) {
            if (obj[i].name == "delid") {
                obj[i].checked = true;
            }
        }
    }

    function unselectAll() {
        var obj = document.fom.elements;
        for (var i = 0; i < obj.length; i++) {
            if (obj[i].name == "delid") {
                if (obj[i].checked == true) obj[i].checked = false;
                else obj[i].checked = true;
            }
        }
    }

    function link() {
        document.getElementById("fom").action = "yuangong.htm";
        document.getElementById("fom").submit();
    }


</SCRIPT>

<body>
<form name="fom" id="fom" method="post">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">


        <tr>
            <td>
                <table id="subtree1" width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td>
                            <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td height="40" class="font42">
                                        <table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#464646"
                                               class="newfont03">

                                            <tr>
                                                <td height="20" colspan="15" align="center" bgcolor="#EEEEEE"
                                                    class="tablestyle_title" style="text-align: center;"> 记录列表
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="6%" align="center" bgcolor="#EEEEEE">选择</td>

                                                <td width="9%" align="center" bgcolor="#EEEEEE">成员姓名</td>
                                                <td width="9%" align="center" bgcolor="#EEEEEE">方式</td>
                                                <td width="9%" align="center" bgcolor="#EEEEEE">金额</td>
                                                <td width="9%" align="center" bgcolor="#EEEEEE">日期</td>
                                                <td width="9%" align="center" bgcolor="#EEEEEE">操作</td>
                                            </tr>
                                            <c:if test="${monies.size()==0}">
                                                <tr>
                                                    <td bgcolor="#FFFFFF" colspan="11">
                                                        当前没有成员
                                                    </td>
                                                </tr>

                                            </c:if>
                                            <c:if test="${monies.size()!=0}">
                                                <%--													循环之前定义变量，存储总人数的初始化值 相当于pagecontext.setAttribute--%>
                                                <c:set var="count" value="0"></c:set>
                                                <c:forEach items="${monies}" var="money">

                                                    <tr>
                                                        <td bgcolor="#FFFFFF"><input type="checkbox" name="delid"/></td>
                                                        <td bgcolor="#FFFFFF">${money.familyMember.name}</td>
<%--                                                        <td bgcolor="#FFFFFF">${zhichu.id}</td>--%>
                                                        <td bgcolor="#FFFFFF">${money.flag}</td>
                                                        <td bgcolor="#FFFFFF">${money.money}</td>
                                                        <td bgcolor="#FFFFFF">${money.time}</td>
                                                        <td bgcolor="#FFFFFF">
                                                            <a href="/ffms/DeleteMoneyServlet?id=${money.id}&flag=${flag}">删除</a>

                                                            &nbsp;|&nbsp;
                                                            <a href="/ffms/PreUpdateMoneyServlet?id=${money.id}&flag=${flag}">修改</a>
                                                        </td>

                                                    </tr>
                                                    <%--														每循环一下，更新统计总人数的最新值--%>
                                                    <c:set var="count" value="${count+1}"></c:set>
                                                </c:forEach>
                                                <%--<%--%>
                                                <%-- List<FamilyMember> familyMemberList2 =(List<FamilyMember>) request.getAttribute("familyMemberList");--%>
                                                <%--for(int i=0;i<familyMemberList2.size();i++){--%>
                                                <%--FamilyMember fm =familyMemberList2.get(i);--%>
                                                <%-- %>--%>
                                                <tr>
                                                    <td bgcolor="#FFFFFF" colspan="11">
                                                        当前总记录条数是：${count}
                                                    </td>
                                                </tr>
                                            </c:if>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>

            </td>
        </tr>
    </table>
</form>
</body>

</html>
